package org.imraniqbal.frogger;

import org.imraniqbal.engine.Item;
import org.imraniqbal.engine.Map;
import org.imraniqbal.engine.Mappable;

public class Flower extends Item {

	public Flower(int x, int y) {
		super(x, y);
	}
	/**
	 * @author imran
	 */
	@Override
	public void action(Object obj, Map map) {
		if(!(obj instanceof Frogger)){ return;	}
		 ((Frogger)obj).setHasFlower(true);
	}
	/**
	 * @author imran
	 */
	@Override
	public boolean equals(Object obj){
		if(obj instanceof Flower){
			return(((Mappable)obj).getX() == this.getX() && this.getY() == ((Mappable)obj).getY());
		}
		return false;
	}
}
